package org.easy.db.generator;

import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author wuxueli
 */
@Getter
public enum ColumnType {

    /**
     *
     */
    DATE("date", "java.util.Date"),
    TIME("time", "java.util.Date"),
    DATETIME("datetime", "java.util.Date"),
    BIG_DECIMAL("decimal", "java.math.BigDecimal");

    /**
     * 类型
     */
    private final String type;
    /**
     * 包路径
     */
    private final String pkg;

    ColumnType(final String type, final String pkg) {
        this.type = type;
        this.pkg = pkg;
    }

    public static String getPkg (String type) {

        for (ColumnType columnType : ColumnType.values()) {
            if (columnType.getType().equals(type)) {
                return columnType.getPkg();
            }
        }
        return null;
    }


}
